package tunafish2k.rpgex.registries;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
import tunafish2k.rpgex.RpgEX;
import tunafish2k.rpgex.entities.StoneDartProjectile;

public class EntityRegistry {
    public static EntityType<StoneDartProjectile> STONE_DART = EntityType.Builder
            .create((EntityType.EntityFactory<StoneDartProjectile>) StoneDartProjectile::new, SpawnGroup.MISC)
            .dimensions(0.5F, 0.5F).eyeHeight(0.13F).maxTrackingRange(4).trackingTickInterval(20).build();

    public static <T extends Entity> EntityType<T> register(String id, EntityType<T> entityType) {
        return Registry.register(Registries.ENTITY_TYPE, Identifier.of(RpgEX.MOD_ID, id), entityType);
    }

    public static void registerAll() {
        register("stone_dart", STONE_DART);
    }
}
